<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="../../common.jsp"></jsp:include>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>角色信息</title>
    <!-- 导入ztree类库 -->
    <link rel="stylesheet"
          href="${pageContext.request.contextPath }/ztree/zTreeStyle.css"
          type="text/css" />
    <script
            src="${pageContext.request.contextPath }/ztree/jquery.ztree.all-3.5.js"
            type="text/javascript"></script>  
            
            
            
       <!-- ztree的js和css -->
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/ztree/css/zTreeStyle/zTreeStyle.css">
  <script type="text/javascript" src="${pageContext.request.contextPath }/ztree/js/jquery.ztree.core.js"></script>
  <script type="text/javascript" src="${pageContext.request.contextPath }/ztree/js/jquery.ztree.excheck.js"></script>
  <script type="text/javascript" src="${pageContext.request.contextPath }/ztree/js/jquery.ztree.exedit.js"></script>
<script type="text/javascript">
$(function () {

    //1.初始化Table
    var oTable = new TableInit();
    oTable.Init();

    //2.初始化Button的点击事件
    var oButtonInit = new ButtonInit();
    oButtonInit.Init();
	//初始化提示框的位置：top-center，bottom-left，bottom-right
    toastr.options.positionClass = 'toast-top-center';
	//模态框关闭事件
    $('#exampleModal').on('hide.bs.modal',function(){
    	var treeObj = $.fn.zTree.getZTreeObj("permissionId");//根据 treeId 获取 zTree 对象
    	treeObj.expandAll(false);//折叠全部节点,参数为true时表示展开全部节点
    	treeObj.checkAllNodes(false); //实现不选中任何节点
    	//表单清空
    	$("#fm")[0].reset();
    	//表单验证清空
    	$('#fm').data('bootstrapValidator').resetForm(true);
    });
    
    
  	//jQuery，既阻止默认行为又停止冒泡  导入按钮
    $(".submit").on('click',function(){
    	    return false;//当然 也阻止了事件本身
    });

});


var TableInit = function () {
    var oTableInit = new Object();
    //初始化Table
    oTableInit.Init = function () {
        $('#tb_table').bootstrapTable({
            url: '${pageContext.request.contextPath }/upmsRole/list.do',         //请求后台的URL（*）
            method: 'get',                      //请求方式（*）
            toolbar: '#toolbar',                //工具按钮用哪个容器
            striped: true,                      //是否显示行间隔色
            cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
            pagination: true,                   //是否显示分页（*）
            sortable: false,                     //是否启用排序
            sortOrder: "asc",                   //排序方式
            queryParams: oTableInit.queryParams,//传递参数（*）
            sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
            pageNumber:1,                       //初始化加载第一页，默认第一页
            pageSize: 10,                       //每页的记录行数（*）
            pageList: [10, 20, 30],        //可供选择的每页的行数（*）
            strictSearch: true,
            minimumCountColumns: 2,             //最少允许的列数
            clickToSelect: true,                //是否启用点击选中行
            height: 550,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
            uniqueId: "roleId",                     //每一行的唯一标识，一般为主键列
            detailView: true,                   //是否显示父子表
            columns: [{
                checkbox: true
            }, {
                field: 'roleId',
                title: 'id',
                visible: false
            }, {
                field: 'name',
                title: '名称'
            }, {
                field: 'title',
                title: '标题'
            }, {
                field: 'description',
                title: '描述'
            /* }, {
                field: 'orders',
                title: '排序' */
            }, {
                field: 'ctime',
                title: '创建时间'
            }],
            onExpandRow:function(index, row, $detail) {  
	       		oTableInit.Init(index, row, $detail);  
	        }
        });
        oTableInit.Init = function(index, row, $detail) {  
            var salesNo = row.salesNo  
            var cur_table = $detail.html('<table></table>').find('table');  
            $(cur_table).bootstrapTable({  
            	url: '${pageContext.request.contextPath }/UpmsRolePermission/list.do' ,
            	method: 'get',                      //请求方式（*）
                striped: true,                      //是否显示行间隔色
                sortable: false,                     //是否启用排序
                sortOrder: "asc",                   //排序方式
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pagination: true,                   //是否显示分页（*）
                pageNumber:1,                       //初始化加载第一页，默认第一页
                pageSize: 3,                       //每页的记录行数（*）
                pageList: [3, 5, 10],        //可供选择的每页的行数（*）
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                queryParams: function (params) {
                	var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                  		page: params.offset/params.limit+1,   //页面大小
                        pageSize: params.limit,  //页码
                        roleId:row.roleId,
                     };
                     return temp;
                },
                columns: [  {
                    field: 'permissionId',
                    title: 'id',
                    visible: false 
                }, {
                    field: 'upmsPermission.systemId',
                    title: '所属系统'
                }, {
                    field: 'upmsPermission.ctime',
                    title: '所属上级'
                }, {
                    field: 'upmsPermission.name',
                    title: '名称'
                }, {
                    field: 'upmsPermission.type',
                    title: '类型',
                   	formatter : function(value, row, index) {
                        if(value == 1){
                            return  "目录";
                        }else if(value == 2){
                            return  "菜单";
                        }else if(value == 3){
                            return  "按钮";
                        }
                    }
                }, {
                    field: 'upmsPermission.uri',
                    title: '路径'
                }, {
                    field: 'upmsPermission.icon',
                    title: '图标'
                }, {
                    field: 'upmsPermission.status',
                    title: '状态',
                   	formatter : function(value, row, index) {
                        if(value == 0){
                            return  "禁止";
                        }else if(value == 1){
                            return  "正常";
                        }
                    }
                /* }, {
                    field: 'upmsPermission.ctime',
                    title: '创建时间' */
                }, {
                    field: 'upmsPermission.orders',
                    title: '排序'
                }]  
            }); 
       	}
    };

    //得到查询的参数
    oTableInit.queryParams = function (params) {
        var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
      		page: params.offset/params.limit+1,   //页面大小
            pageSize: params.limit,  //页码
            name:$.trim($('#nameTJ').val()), 
            title:$.trim($('#titleTJ').val()),    
        };
        return temp;
    };
    return oTableInit;
};


var ButtonInit = function () {
    var oInit = new Object();
    var postdata = {};

    oInit.Init = function () {
        //初始化页面上面的按钮事件
    };

    return oInit;
};

//判断本页是否数据是否为空，如果为空跳转至第一页
function refresh(){
	setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
		var row=$('#tb_table').bootstrapTable('getData');
		if(row.length == 0){
			$("#tb_table").bootstrapTable("refreshOptions",{pageNumber:1});
		}
	},1000);
}
//删除
function doDelete() {
	var row = $.map($("#tb_table").bootstrapTable('getSelections'),function(row){
		return row ;
	});
	if (row.length == 0) {
		toastr.warning('请至少选择一条数据!');
	}else{
		var ids = "";
		var names = "";
		for(var i = 0;i < row.length;i++){
			if(i == 0 || i == "0"){
				ids += row[i].roleId;
			}else{
				ids += "," + row[i].roleId;
			}
		}
		
		//询问框
		Ewin.confirm({ message: "确认要删除选择的数据吗？" }).on(function (e) {
	       if (!e) {
	         return;
	       } 
	    	var url = "${pageContext.request.contextPath }/upmsRole/delete.do";
		    $.post(url, "ids="+ids, function(data) {
				if (data == 1) {
					toastr.success('删除成功');
					setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
						$('#tb_table').bootstrapTable('refresh');
						refresh();
					},1000);
				} else {
					toastr.error('删除失败');
					setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
						$('#tb_table').bootstrapTable('refresh');
						refresh();
					},1000);
				}
			}); 
	    }); 
	}
}
//打开添加框
function doAdd() {
	
	$("#bt").html("新增角色信息");
	$("#roleId").val("");
	$('#exampleModal').modal(open);
}

//打开修改框
function doView() {
	//取表格的选中行数据
    var row = $("#tb_table").bootstrapTable('getSelections');
	if (row.length == 1) {
		$("#bt").html("修改角色信息");
		$("#roleId").val(row[0].roleId);
		$("#name").val(row[0].name);
		$("#title").val(row[0].title);
		$("#description").val(row[0].description);
		//$("#orders").val(row[0].orders);
		
		
        $.ajax({
            type: "post",
            data: "roleId="+row[0].roleId,
            url: "${pageContext.request.contextPath }/UpmsRolePermission/queryAll.do",
             dataType: 'JSON',
             async: false,
             success: function (arr) {
		        for(var i=0;i<arr.length;i++){
		        	var treeObj = $.fn.zTree.getZTreeObj("permissionId");//根据 treeId 获取 zTree 对象
		        	//treeObj.expandAll(true);//折叠全部节点,参数为true时表示展开全部节点
		        	//treeObj.refresh();//刷新zTree，实现不选中任何节点
		        	//当前选中的节点
		        	var nodes = treeObj.getNodesByParam("id", arr[i].permissionId);
		        	//勾选当前选中的节点
		            treeObj.checkNode(nodes[0],true,true); 
		        }
             }
		});
        
		
		$('#exampleModal').modal(open);
	}else{
		toastr.warning('请选择一条数据!');
	}
}
//表单提交
function save() {
    var bootstrapValidator = $("#fm").data('bootstrapValidator');  
    //开启验证
    bootstrapValidator.validate();  
    if (bootstrapValidator.isValid()){
		var url = "";
		var title = "";
    	if (document.getElementById('roleId').value == '') {
			url = "${pageContext.request.contextPath }/upmsRole/add.do";
			title = "新增";
    	} else {
			url = "${pageContext.request.contextPath }/upmsRole/update.do";
			title = "修改";
    	}  
    	//在提交表单之前，使用ztree提供的方式获取选中的节点
        var treeObj = $.fn.zTree.getZTreeObj("permissionId");//获得ztree对象
        var nodes = treeObj.getCheckedNodes(true);//在提交表单之前将选中的checkbox收集
        var array = new Array();
        for(var i=0;i<nodes.length;i++){
            var id = nodes[i].id;
            array.push(id);
        }
        var ids = array.join(",");
        //在提交表单之前，将ids字符串赋值给隐藏域
        $("input[name=permissionIds]").val(ids);
    	
	    $.post(url, $("#fm").serialize(), function(data) {
			if (data == 1) {
				toastr.success(title+'成功');
				setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
					$('#exampleModal').modal('hide');
					$('#tb_table').bootstrapTable('refresh');  
					refresh();
				},1000);
			} else {
				toastr.error(title+'失败，该角色名称已存在，不能重复');
			}
		});
    }else{
	    return;  
    } 
}
//刷新表格
function seach() {
	$("#tb_table").bootstrapTable("refreshOptions",{pageNumber:1});
}
</script>
</head>
<body>
	<div class="panel-body" style="padding-bottom:0px;">
        <div class="panel panel-default">
            <div class="panel-heading">查询条件</div>
            <div class="panel-body">
                <form id="formSearch" class="form-horizontal">
                    <div class="form-group" style="margin-top:15px">
                        <label class="control-label col-sm-1" for="nameTJ">名称</label>
                        <div class="col-sm-3">
                            <input type="text" class="form-control" id="nameTJ">
                        </div>
                        <label class="control-label col-sm-1" for="titleTJ">标题</label>
                        <div class="col-sm-3">
                            <input type="text" class="form-control" id="titleTJ">
                        </div>
                        <div class="col-sm-4">
                            <button type="button" style="margin-left: 20%;" id="btn_query" class="btn btn-primary" onclick="seach()">查询</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>       

		


        <div id="toolbar" class="btn-group">
            <button id="btn_add" type="button" class="btn btn-default" onclick="doAdd()">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
            </button>
            <button id="btn_edit" type="button" class="btn btn-default" onclick="doView()">
           		 <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
            </button>
            <button id="btn_delete" type="button" class="btn btn-default" onclick="doDelete()">
                <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
            </button>
            <!-- <button id="btn_add" type="button" class="btn btn-default" onclick="douploadModal()">
                <span class="glyphicon glyphicon-bullhorn" aria-hidden="true"></span>导入
            </button>
            <button id="btn_delete" type="button" class="btn btn-default" onclick="doExportall()">
                <span class="glyphicon glyphicon-export" aria-hidden="true"></span>导出所有
            </button> -->
            
            
            <script type="text/javascript">
	        	function doExportall() {
	        		Ewin.confirm({message : "确认导出所有数据吗？"}).on(
    					function(e) {
   						if (!e) {return;}
						window.location.href="${pageContext.request.contextPath}/upmsRole/doExportall.do"; 
					})
				}
	        	
	        	function douploadModal() {
	        		$('#uploadModal').modal(open);
	        		//清空表单
	        		document.getElementById("importForm").reset();
	        	}
	        	
	        	function uploadBtn() {
	        		 var fileName = $("#fileInput").val();
	        		 if (fileName.length > 0) {
	        		     var formData = new FormData($("#importForm")[0]);  
	        		     $.ajax({  
	        		          url: '${pageContext.request.contextPath}/upmsRole/uplodeFile.do' ,  
	        		          type: 'post',  
	        		          data: formData,
	        		          async: false,  
	        		          cache: false,  
	        		          contentType: false,  
	        		          processData: false,  
	        		          success: function (data) { 
	        		        	  if (data == 1) {
	        		        		  toastr.success("文件导入成功（角色名称重复的数据直接过滤）！");
	        		        		  setTimeout(function() {//使用setTimeout()方法设定定时2000毫秒
	        		        		    $('#uploadModal').modal('hide'); 
	        		        		   $('#tb_table').bootstrapTable('refresh'); 
	        						  },1000);
	        		        	  }else if(data == -1){
	        		        		  toastr.warning("导入的数据不符合导入条件（角色名称不能重复）！");  
	        		        	  }else{
	        		        		  toastr.warning("文件格式异常，文件导入失败！");  
	        		        	  }
	        		          },  
	        		          error: function (data) {
	        		        	  toastr.error("文件格式异常，文件导入失败！");  
	        		          }  
	        		     }); 
	        		 }else{
	        			 toastr.warning("上传文件为空，请选择要导入的文件！");  
	        		}
	        	}
	        	
            </script>
        </div>
        <table id="tb_table"></table>
    </div>
    
    <div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
   		<div class="modal-dialog" role="document">
    		<div class="modal-content">
      			<div class="modal-header">
        			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        			<h4 class="modal-title" id="exampleModalLabel">
        				<span>excel导入</span>
        			</h4>
      			</div>
      			<div class="modal-body">
	          		<div style="text-align:right;padding:5px">
                        <a href="${pageContext.request.contextPath }/datas/tray.xls" onclick="javascript:Preview();">
                            <img alt="导入托盘信息-模板" src="${pageContext.request.contextPath }/image/excel_alt_1.png" style="width: 20px;"/>
                            <span style="font-size:larger;font-weight:200;color:red">tray-模板.xls</span>
                        </a>
                    </div>
	        		<form id="importForm" class="form-horizontal">
	          			<div title="Excel导入操作" style="padding: 5px">
					            <input id="fileInput" name="file" type="file" accept=".xls,.xlsx"/>
	          			</div>
	        		</form>
	        		 <!--数据显示表格-->
                    <table id="gridImport" class="table table-striped table-bordered table-hover" cellpadding="0" cellspacing="0" border="0">
                    </table>
	      		</div>
       			<div class="modal-footer"> 
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="submit"  name="submit"  class="btn btn-primary submit" onclick="uploadBtn()">导入</button>
	      		</div>
    		</div>
  		</div>
	</div>
	
	
	
    <div class="modal fade bs-example-modal-lg" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
   		<div class="modal-dialog modal-lg" role="document">
    		<div class="modal-content">
      			<div class="modal-header">
        			<button type="button" class="close closefm" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        			<h4 class="modal-title" id="exampleModalLabel">
        				<span id="bt" style="font-size:13px"></span>
        			</h4>
      			</div>
      			<div class="modal-body">
	          		<form id="fm" class="form-horizontal"  style="margin-right: 10%;">
	          			<div class="form-group">
	           				 <label class="col-sm-2 control-label">名称:</label>
	            			 <div class="col-sm-4"> 
		            			 <input type="text" class="form-control" id="name" name="name"  placeholder="请输入" autocomplete="off">
		            			 <input type="hidden" id="roleId" name="roleId" >
		          				<span class="xing"></span>
	          				</div>
	           				 <label class="col-sm-2 control-label">标题:</label>
	            			 <div class="col-sm-4"> 
		            			 <input type="text" class="form-control" id="title" name="title"  placeholder="请输入" autocomplete="off">
	          				</div>
	          			</div>
	          			<div class="form-group">
	           				 <label class="col-sm-2 control-label">描述:</label>
	            			 <div class="col-sm-4"> 
		          				<textarea rows="2" cols="1" class="form-control" id="description" name="description"  placeholder="请输入" autocomplete="off"></textarea>
	          				</div>
	           				 <!-- <label class="col-sm-2 control-label">排序:</label>
	            			 <div class="col-sm-4"> 
		            			 <input type="text" class="form-control" id="orders" name="orders"  placeholder="请输入" autocomplete="off">
	          				</div>
	          			</div> -->
	          			<!-- <div class="form-group">
	           				 <label class="col-sm-2 control-label">权限:</label>
	            			 <div class="col-sm-8"> 
		            			 <select id="permissionId" name="permissionId" class="form-control select2">
		            			 </select>
		          				 <script type="text/javascript">
		          				$(function () {
			          				  $.ajax({
			          	                type: "post",
			        	                url: "${pageContext.request.contextPath }/upmsPermission/queryAll.do",
			          	                dataType: 'JSON',
			          	                async: false,
			          	                success: function (arr) {
			          				    	var data = [];
			          				        for(var i=0;i<arr.length;i++){
			          				        	if(arr[i].pid == null || arr[i].pid == ""){
			          				        		var childrens = [];
			          				        		for(var j=0;j<arr.length;j++){
					          				        	if(arr[j].pid == arr[i].permissionId ){
					          				        		childrens.push({id:arr[j].permissionId,element: "HTMLOptionElement",text:arr[j].name});
					          				        	} 
			          				        		}
				          					  		data.push({id:arr[i].permissionId,text:arr[i].name,element: "HTMLOptionElement",children:childrens});
			          				        	 } 
			          				        }
			          				    	$('#permissionId').select2({ 
			          				    	  allowClear: true,//清除
			          				    	  multiple:true,
			          				    	  //tags: true,
			          			              //maximumSelectionLength: 1,  //设置最多可以选择多少项
			          				    	  //minimumResultsForSearch: -1, //去模糊查询
			          				    	  language: "zh-CN", //设置 提示语言
			          				          width: "100%", //设置下拉框的宽度
			          				          placeholder: "请选择",
			          				      	  data: data
			          				      });
			          	                }
			          				});
		          				});

		          				 </script>
	          				</div>
	          			</div> -->
	          			<!-- <div class="form-group"> -->
	           				 <label class="col-sm-2 control-label">权限:</label>
	            			 <div class="col-sm-4"> 
								 <ul class="ztree" id="permissionId"></ul>
								 <input type="hidden" name="permissionIds">
	            			 	<script type="text/javascript">
	            			 	$(function(){
	            			 		
	            			 		var setting = {
	            			 		    data:{//表示tree的数据格式
	            			 		        simpleData:{
	            			 		            enable:true,//表示使用简单数据模式
	            			 		            idKey:"id",//设置之后id为在简单数据模式中的父子节点关联的桥梁
	            			 		            pidKey:"pId",//设置之后pid为在简单数据模式中的父子节点关联的桥梁和id互相对应
	            			 		            rootId:"null"//pid为null的表示根节点
	            			 		        }
	            			 		    },
	            			 		    view:{//表示tree的显示状态
	            			 		        selectMulti:false//表示禁止多选
	            			 		    },
	            			 		    check:{//表示tree的节点在点击时的相关设置
	            			 		        enable:true,//是否显示radio/checkbox
	            			 		        chkStyle:"checkbox",//值为checkbox或者radio表示
	            			 		        checkboxType:{p:"",s:""},//表示父子节点的联动效果
	            			 		        radioType:"level"//设置tree的分组
	            			 		    }, 
	            			 		    /* callback:{//表示tree的一些事件处理函数
	            			 		        onClick:handlerClick,
	            			 		    } */
		            			 	}
	            			 		
	            			 		//initTree();
	            			 	    var treeData = [];
	            			 	   $.ajax({
			          	                type: "post",
			        	                url: "${pageContext.request.contextPath }/upmsPermission/queryAll.do",
			          	                dataType: 'JSON',
			          	                async: false,
			          	                success: function (arr) {
			          				        for(var i=0;i<arr.length;i++){
			          				        	if(arr[i].pid == null || arr[i].pid == ""){
			          				        		var childrens = [];
			          				        		for(var j=0;j<arr.length;j++){
					          				        	if(arr[j].pid == arr[i].permissionId ){
					          				        		childrens.push({id:arr[j].permissionId,name:arr[j].name,pId:arr[j].pid});
					          				        	} 
			          				        		}
			          				        		treeData.push({id:arr[i].permissionId,name:arr[i].name,pId:null,children:childrens});
			          				        	 } 
			          				        }
			            			 	  	$.fn.zTree.init($("#permissionId"),setting,treeData);
			          	                },
			        	                error : function(msg) {
			        	                    alert('树加载异常!');
			        	                }
			        	                
			          				});
	            			 	});
	            			 	</script>
	            			 </div>
	            		</div>
	        		</form>
	      		</div>
       			<div class="modal-footer"> 
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				    <button type="submit" class="btn btn-primary submit" onclick="save()">保存</button>
	      		</div>
    		</div>
  		</div>
	</div>
    
    
      
	
	<script type="text/javascript">
	$(function() {
		$("#fm").bootstrapValidator({
			feedbackIcons : {
				valid : 'glyphicon glyphicon-ok',
				invalid : 'glyphicon glyphicon-remove',
				validating : 'glyphicon glyphicon-refresh'
			},
			fields : {
				name : {
					validators : {
						notEmpty : {
							message : '角色名称不能为空'
						},
						callback: {
                            message: '角色名称不能重复',
                            callback:function(value, validator){
                                var flg = false;
                                $.ajax({
                                    type:'post',
                                    data:'name='+value,
                                    url:'${pageContext.request.contextPath}/upmsRole/queryAll.do',
					                dataType: 'JSON',
					                async: false,
                                    success:function (data) {
                                        if(data.length == 0){
                                            flg  = true;
                                        }else if(data.length == 1){
	                                        var ma = $.trim($('#roleId').val());
	                                        if (ma == data[0].roleId) {
	                                            flg  = true;
	                                        }else{
	                                        	flg = false;
	                                        }
                                        }else{
                                            flg = false;
                                        }

                                    }
                                });
                                return flg;
                            }
                        },
					}
				},
			},
		});
	});
	</script>
</body>
</html>